﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace AdminModule.IndexMarkServiceReference
{
    public partial class AdmGradation
    {
        public AdmGradation() : base() { }

        public override int GetKey()
        {
            return this.ID;
        }

        public override Type GetObjType()
        {
            return this.GetType();
        }

        public override void CopyFrom(DTOBase copyFrom)
        {
            AdmGradation g = copyFrom as AdmGradation;

            this.ID = g.ID;
            this.Name = g.Name;
        }

        public string BottomLimitTxtBox
        {
            get
            {
                return this.BottomLimit.ToString();
            }
            set
            {
                double val = 0;
                double.TryParse(value, out val);
                this.BottomLimit = (value.Trim() == string.Empty) ? null : (double?)val;
            }
        }

        public string TopLimitTxtBox
        {
            get
            {
                return this.TopLimit.ToString();
            }
            set
            {
                double val = 0;
                double.TryParse(value, out val);
                this.TopLimit = (value.Trim() == string.Empty) ? null : (double?)val;
            }
        }
    }
}
